/* Represents a node in space. Nodes are what you jump to most of the time.
 * 
 */

package map;

import java.io.Serializable;

public class Node implements Serializable, Comparable<Node>{

	private static final long serialVersionUID = 1L;
	private int row; //the row the node is on
	private int col; //the col the node is on
	private Event event; //the event that will happen on the node
	private int level; //the "level" of the area that will help generate the items and enemies
	private String name; //the name of the node
	EventType type; //the type of event used upon creation to generate the random event
	boolean explored; //holds if the node has been explored or not
	
	//4 params constructor that will set the row, col, and level of the node and will also generate the event
	public Node(int r, int c, int l, EventType e){
		
		row = r;
		col = c;
		level = l;
		type = e;
		explored = false;
	}//int int int EventType constructor
	
	
	//sets the event type to the one passed in
	public void setEvent(EventType e){
		
		type = e;
	}//setEvent
	
	
	//returns a comparasin of the columns
	public int compareTo(Node n){
		
		return this.col - n.col;
	}//compareTo
	
	//returns a string representation fo the node
	public String toString(){
		
		String toReturn = "";
		
		toReturn += "Row: " + row + " Col: " + col + " Level: " + level + " Event Type: " + type;
		return toReturn;
	}//toString
}//Node